<template>
  <el-dialog :visible="showTriptsDialog" title="新增车次" @close="close">
    <el-form ref="triptsForm" label-width="120px">
      <el-form-item label="线路名称">
        <el-input :value="name" disabled />
      </el-form-item>
      <el-form-item label="车次名称">
        <el-input v-model="tripts.name" />
      </el-form-item>
      <el-form-item label="发车时间">
        <!-- <el-input v-model="tripts.departureTime" /> -->
        <el-time-picker
          v-model="tripts.departureTime"
          placeholder="请选择发车时间"
          format="HH:mm"
          style="width:100%"
          value-format="HH:mm"
          clearable=""
        />
      </el-form-item>
      <el-form-item label="持续时间">
        <el-input v-model.number="tripts.estimatedTime" />
      </el-form-item>
      <el-form-item label="发车周期">
        <el-select v-model="tripts.periodName" style="width:100%" clearable>
          <el-option value="天">天</el-option>
          <el-option value="周">周</el-option>
          <el-option value="月">月</el-option>
        </el-select>
      </el-form-item>
    </el-form>
    <template #footer>
      <el-row type="flex" justify="center">
        <el-button type="primary">确认</el-button>
        <el-button>取消</el-button>
      </el-row>
    </template>
  </el-dialog>
</template>

<script>
export default {
  props: {
    showTriptsDialog: {
      type: Boolean,
      default: null
    }
  },
  data() {
    return {
      name: '',
      tripts: {
        departureTime: '',
        estimatedTime: '',
        name: '',
        period: '',
        periodName: '',
        transportLineId: ''
      }
    }
  },
  methods: {
    close() {
      this.lineFormData = {
        departureTime: '',
        estimatedTime: '',
        name: '',
        period: '',
        periodName: '',
        transportLineId: ''
      }
      this.$refs.triptsForm.resetFields()
      this.$parent.showTriptsDialog = false
    }
  }
}
</script>

<style>

</style>
